Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: PostgreSQL supports newline in quoted literals and identifiers #1731

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

olavloite
Copy link
Collaborator

PostgreSQL supports newline characters in string literals and quoted
identifiers. Trying to execute a statement with a string literal or
quoted identifier that contained a newline character would cause an
'Unclosed string literal' error.

Fixes #1730

PostgreSQL supports newline characters in string literals and quoted
identifiers. Trying to execute a statement with a string literal or
quoted identifier that contained a newline character would cause an
'Unclosed string literal' error.

Fixes #1730
@olavloite olavloite requested review from thiagotnunes and ansh0l March 7, 2022 12:33
@olavloite olavloite requested a review from a team as a code owner March 7, 2022 12:33
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Mar 7, 2022
@@ -56,95 +56,44 @@ protected boolean supportsExplain() {
@Override
String removeCommentsAndTrimInternal(String sql) {
Preconditions.checkNotNull(sql);
String currentTag = null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be easier to open the entire file (online or in an IDE) to review it, than to try to do that based on this diff render from GitHub. The parser code has also been compacted a lot, as there was quite a lot of code duplication, and that makes this diff render a lot harder to read.

@olavloite olavloite added automerge Merge the pull request once unit tests and other checks pass. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Mar 8, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 8, 2022
@olavloite olavloite merged commit f403d99 into main Mar 8, 2022
@olavloite olavloite deleted the postgresql-newlines-in-quoted branch March 8, 2022 07:23
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostgreSQL statement parsing fails on string literals with newline characters
3 participants